from django_filters import rest_framework as filters
from zmad.models import ZTPUser


class UserFilter(filters.FilterSet):
    demand = filters.CharFilter(field_name='demands__demand')
    is_active = filters.BooleanFilter(field_name='activity_status__is_active')
    is_abnormal = filters.BooleanFilter(field_name='activity_status__is_abnormal')

    class Meta:
        model = ZTPUser
        fields = ('demand', 'is_active', 'is_abnormal')
